package csc.fresher.spring.dao;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.jdbc.core.RowMapper;

import csc.fresher.spring.domain.Employee;

public class EmployeeMapper implements RowMapper<Employee>{

	@Override
	public Employee mapRow(ResultSet rs, int rowNum) throws SQLException {
		Employee e = new Employee();
		e.setId(rs.getInt("id"));
		e.setName(rs.getString("name"));
		e.setAge(rs.getInt("age"));
		e.setPosition(rs.getString("position"));
		e.setPhone(rs.getString("phone"));
		e.setAddress(rs.getString("address"));
		e.setDateJoin(rs.getDate("dateJoin"));
		return e;
	}

}
